<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj = {
            name:'韩威臣',
            msg:'韩威臣与武烁，一直在讨论对象问题！！',
            foo:function(){
                console.log('xx');
            }
        }
        obj.foo();
        // 对象的简写方式
        let  name = 'tom';
        let msg = 'tom and rose';
        let obj1 = {
            name:name,
            msg:msg,
            fun:function(){
                console.log('yyy');
            }
        }
        // 省略了同名属性值 省略了关键字function
        let obj2 = {
            name,
            msg,
            fun(){
                console.log('闰土');
            }
        }
        console.log(obj2);
    </script>
</body>
</html>